# Contributor: k0r10n <k0r10n.dev@gmail.com>
# Contributor: Ivan Tham <pickfire@riseup.net>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=extra-cmake-modules
pkgver=5.95.0
pkgrel=0
pkgdesc="Extra CMake modules"
url="https://projects.kde.org/projects/kdesupport/extra-cmake-modules"
arch="noarch"
license="BSD-3-Clause"
depends="cmake"
makedepends="py3-sphinx samurai"
checkdepends="qt5-qtbase-dev qt5-qtquickcontrols2-dev"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/extra-cmake-modules-$pkgver.tar.xz"
subpackages="$pkgname-doc"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DSphinx_BUILD_EXECUTABLE=/usr/bin/sphinx-build
	cmake --build build
}

check() {
	cd build
	# Broken tests
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "(KDEFetchTranslations|KDEInstallDirsTest.relative_or_absolute_usr|KDEInstallDirsTest.relative_or_absolute_qt)"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
b99cda146c4dec0c21bd558d6435996aaacf3db819f96ca16a0344d8da8dd30bb3ff37aa03f2ac78c4e5da6b0874844fba2bebd24015a804ba985c93c924064e  extra-cmake-modules-5.95.0.tar.xz
"
